<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<ul class="menu">
<?php 
$cate= JRequest::getVar('cate', '0');
$opt=$_GET["option"];
$x=0;
$mymenuitem = $params->get('mymenuitem');
$ehome = $params->get('ehome');


if($opt=='com_odudecard' && $cate=='')
echo "<li id=\"current\" class=\"parent active item0\"><a href=".JRoute::_("index.php?Itemid=".$mymenuitem."&option=com_odudecard").">Ecard Home</a>";
else
echo "<li class=\"item0\"><a href=".JRoute::_("index.php?Itemid=".$mymenuitem."&option=com_odudecard").">".$ehome."</a>";

for( $i=0; $i<count($hello); $i++ )
		{
			$row = $hello[$i];
			if($cate==$row->cat)
			echo "<li id=\"current\" class=\"parent active item".$row->cat."\"><a href=".JRoute::_("index.php?option=com_odudecard&controller=odudecardlist&Itemid=".$mymenuitem."&cate=".$row->cat).">".$row->name."</a>";
			else
			echo "<li class=\"item".$row->cat."\"><a href=".JRoute::_("index.php?option=com_odudecard&controller=odudecardlist&Itemid=".$mymenuitem."&cate=".$row->cat).">".$row->name."</a>";
			
			if($params->get('expand_menu')==1)
			{
				//if($cate==$row->cat)
			//{
					$sub = modODudecardMenuHelper::getSub($row->cat);
					
					if(count($sub)!=0)
					{
					echo "<ul>";
					$x=1;
					}
					else
					{
					echo "</li>";	
					}
					
					for( $j=0; $j<count($sub); $j++ )
					{
						$subcat=$sub[$j];
						echo "<li  class=\"item".$subcat->cat."\"><a href=".JRoute::_("index.php?option=com_odudecard&controller=odudecardlist&Itemid=".$mymenuitem."&cate=".$subcat->cat).">".$subcat->name."</a></li>";
		
					}
					
					if($x==1)
					{
					echo "</ul></li>";
					$x=0;
					}
			//}
			}
			else
			{
			if($cate==$row->cat)
			{
					$sub = modODudecardMenuHelper::getSub($row->cat);
					
					if(count($sub)!=0)
					{
					echo "<ul>";
					$x=1;
					}
					else
					{
					echo "</li>";	
					}
					
					for( $j=0; $j<count($sub); $j++ )
					{
						$subcat=$sub[$j];
						echo "<li  class=\"item".$subcat->cat."\"><a href=".JRoute::_("index.php?option=com_odudecard&controller=odudecardlist&Itemid=".$mymenuitem."&cate=".$subcat->cat).">".$subcat->name."</a></li>";
		
					}
					
					if($x==1)
					{
					echo "</ul></li>";
					$x=0;
					}
			}
			}
			
			
			
				
		} 
?>
</ul>
